package com.xiefengf.elasticsearch.jd.model;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import org.springframework.data.elasticsearch.annotations.Setting;

/**
 * @author xiefengf
 * @version 1.0
 * @date 2024/4/6 23:06
 */
@Document(indexName = "content", createIndex = false)
@Setting(shards = 1, replicas = 0)
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class Content {

    /**
     * 唯一标识
     */
    @Id
    private Long id;

    /**
     * 商品名称
     */
    @Field(type = FieldType.Text, analyzer = "ik_smart")
    private String title;

    /**
     * 图片地址
     */
    @Field(type = FieldType.Keyword, index = false)
    private String img;

    /**
     * 商品价格
     */
    @Field(type = FieldType.Text, analyzer = "standard")
    private String price;

    /**
     * 商铺名称
     */
    @Field(type = FieldType.Keyword)
    private String shopName;

}
